def find_words(prefix)
    return if prefix.empty?
    words = File.readlines('words').map(&:chomp).reject{|w| w.include?("'")}
    words.select{|w| w =~ /\A#{prefix}/}
end

puts find_words('gnu')
puts find_words('ruby')
puts find_words('fnord')